/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.common.constant.project;

/**
 * 系统测评阶段
 * @author zpy
 * @version 1.0.0
 */
public enum SystemState {

    /**未启动**/
    DEFAULT(0,"未启动"),
    /**测评准备**/
    PREPARE(1,"测评准备"),
    /**方案编制**/
    PLANNING(2,"方案编制"),
    /**现场测评**/
    EVALUATION(3,"现场测评"),
    /**分析与报告编制**/
    REPORT(4,"分析与报告编制"),
    /**密评证明记录**/
    PROOF(5,"密评证明记录");

    private final int state;
    private final String name;

    SystemState(int state, String name) {
        this.state = state;
        this.name = name;
    }

    public static SystemState fromState(Integer state){
        SystemState data = DEFAULT;
        for(SystemState tt :SystemState.values()){
            if(tt.state == state){
                data = tt;
                break;
            }
        }
        return data;
    }

    public int getState(){
        return this.state;
    }

    public String getName(){
        return this.name;
    }
}